package com.siyu.prewarn.skreservoirdutyperson.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.siyu.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.siyu.prewarn.skreservoirdutyperson.mapper.SkReservoirDutyPersonMapper;
import com.siyu.prewarn.skreservoirdutyperson.domain.SkReservoirDutyPerson;
import com.siyu.prewarn.skreservoirdutyperson.service.ISkReservoirDutyPersonService;

/**
 * 水库责任人基础信息Service业务层处理
 *
 * @author hrhy
 * @date 2024-06-27
 */
@Service
public class SkReservoirDutyPersonServiceImpl extends ServiceImpl<SkReservoirDutyPersonMapper, SkReservoirDutyPerson> implements ISkReservoirDutyPersonService
{
    @Autowired
    private SkReservoirDutyPersonMapper skReservoirDutyPersonMapper;

    /**
     * 查询水库责任人基础信息
     *
     * @param id 水库责任人基础信息主键
     * @return 水库责任人基础信息
     */
    @Override
    public SkReservoirDutyPerson selectSkReservoirDutyPersonById(Long id)
    {
        return skReservoirDutyPersonMapper.selectSkReservoirDutyPersonById(id);
    }

    /**
     * 查询水库责任人基础信息列表
     *
     * @param skReservoirDutyPerson 水库责任人基础信息
     * @return 水库责任人基础信息
     */
    @Override
    public List<SkReservoirDutyPerson> selectSkReservoirDutyPersonList(SkReservoirDutyPerson skReservoirDutyPerson)
    {
        return skReservoirDutyPersonMapper.selectSkReservoirDutyPersonList(skReservoirDutyPerson);
    }

    /**
     * 新增水库责任人基础信息
     *
     * @param skReservoirDutyPerson 水库责任人基础信息
     * @return 结果
     */
    @Override
    public int insertSkReservoirDutyPerson(SkReservoirDutyPerson skReservoirDutyPerson)
    {
                skReservoirDutyPerson.setCreateTime(DateUtils.getNowDate());
            return skReservoirDutyPersonMapper.insertSkReservoirDutyPerson(skReservoirDutyPerson);
    }

    /**
     * 修改水库责任人基础信息
     *
     * @param skReservoirDutyPerson 水库责任人基础信息
     * @return 结果
     */
    @Override
    public int updateSkReservoirDutyPerson(SkReservoirDutyPerson skReservoirDutyPerson)
    {
                skReservoirDutyPerson.setUpdateTime(DateUtils.getNowDate());
        return skReservoirDutyPersonMapper.updateSkReservoirDutyPerson(skReservoirDutyPerson);
    }

    /**
     * 批量删除水库责任人基础信息
     *
     * @param ids 需要删除的水库责任人基础信息主键
     * @return 结果
     */
    @Override
    public int deleteSkReservoirDutyPersonByIds(Long[] ids)
    {
        return skReservoirDutyPersonMapper.deleteSkReservoirDutyPersonByIds(ids);
    }

    /**
     * 删除水库责任人基础信息信息
     *
     * @param id 水库责任人基础信息主键
     * @return 结果
     */
    @Override
    public int deleteSkReservoirDutyPersonById(Long id)
    {
        return skReservoirDutyPersonMapper.deleteSkReservoirDutyPersonById(id);
    }
}


